package com.ysy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ysy.dto.UserDTO;
import com.ysy.entity.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 用户表 Mapper 接口
 * </p>
 *
 * @author yangSy
 * @since 2025-04-21
 */
public interface UserMapper extends BaseMapper<User> {

    @Select("<script>" +
            "SELECT id, name, phone, avatar, introduction " +
            "FROM User " +
            "WHERE status = 0 " +
            "AND id IN " +
            "<foreach collection='ids' item='id' open='(' separator=',' close=')'>" +
            "   #{id}" +
            "</foreach>" +
            "</script>")
    List<UserDTO> selectSimpleUsers(@Param("ids") List<Long> ids);



}

